let ipt = document.getElementsByTagName("input")
let code = []

for (let i = 0; i < ipt.length; i++) {
    ipt[i].oninput = function () {
       let val = this.value
       if(val.length == 1 && !isNaN(val)){
            if (ipt[i] == ipt[5]) {
                ipt[i].focus()
                code.push(val)
                alert(code.join(""))
            }else { 
                code.push(val)
                ipt[i+1].focus()
            }
       }

    }
}

